<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="fm">
							<input id="userId" name="userId" type="hidden" th:value="${user.userId}">
							<div class="form-group">
								<label class="col-sm-3 control-label">姓名：</label>
								<div class="col-sm-8">
									<input id="name" name="name" class="form-control" 
									type="text" th:value="${user.name}" readonly>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">用户名：</label>
								<div class="col-sm-8">
									<input id="username" name="username" class="form-control"
										type="text" th:value="${user.username}" readonly>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">手机号码：</label>
								<div class="col-sm-8">
									<input id="mobile" name="mobile" class="form-control"
										type="text" th:value="${user.mobile}" readonly>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">可提现金额：</label>
								<div class="col-sm-8">
									<input id="unWithdrawCommission" name="unWithdrawCommission" class="form-control"
										type="text" th:value="${user.unWithdrawCommission}" readonly>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">请输入提现金额：</label>
								<div class="col-sm-8">
									<input id="commission" name="commission" class="form-control"
										type="text">
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="button" onclick="applyCommission()" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript">
		function applyCommission() {
			$.ajax({
				cache : true,
				type : "POST",
				url : "/partner/applyCommission/apply",
				data : $('#fm').serialize(),// 你的formid
				async : false,
				error : function(request) {
					alert("Connection error");
				},
				success : function(data) {
					if (data.code == 0) {
						alert("申请成功");
						location.reload();						
					} else {
						alert(data.msg);
					}
				}
			});
		}
	</script>
</body>
</html>
